<template>
  <div class="container">
    <!-- 顶部太阳能系统状态 -->
    <div class="solar-status">
      <h1>太阳能电池充电监控系统</h1>
      <div class="solar-metrics">
        <div class="metric-card">
          <div class="metric-label">当前输出功率</div>
          <div class="metric-value">4.8kW</div>
        </div>
        <div class="metric-card">
          <div class="metric-label">光电转换效率</div>
          <div class="metric-value">82%</div>
        </div>
      </div>
    </div>

    <!-- 电池卡片区域 -->
    <div class="dashboard">
      <!-- 电池组 #1 -->
      <div class="battery-card working">
        <div class="battery-header">
          <div class="battery-title">
            <i class="fas fa-battery-full"></i>
            <span>电池组 #1 (工作中)</span>
          </div>
          <div class="battery-status">工作中</div>
        </div>
        
        <div class="battery-level">68%</div>
        <div class="battery-icon">
          <i class="fas fa-battery-three-quarters"></i>
        </div>
        
        <div class="progress-section">
          <div class="progress-label">当前电量</div>
          <div class="progress-bar">
            <div class="progress-fill" style="width: 68%"></div>
          </div>
        </div>
        
        <div class="battery-stats">
          <div class="stat-item">
            <div class="stat-label">输出电压</div>
            <div class="stat-value">11.2V</div>
          </div>
          <div class="stat-item">
            <div class="stat-label">输出电流</div>
            <div class="stat-value">2.3A</div>
          </div>
          <div class="stat-item">
            <div class="stat-label">温度</div>
            <div class="stat-value">32°C</div>
          </div>
          <div class="stat-item">
            <div class="stat-label">健康状态</div>
            <div class="stat-value">98%</div>
          </div>
        </div>
      </div>
      
      <!-- 电池组 #2 -->
      <div class="battery-card charging">
        <div class="battery-header">
          <div class="battery-title">
            <i class="fas fa-battery-quarter"></i>
            <span>电池组 #2 (充电中)</span>
          </div>
          <div class="battery-status">充电中</div>
        </div>
        
        <div class="battery-level">42%</div>
        <div class="battery-icon">
          <i class="fas fa-battery-quarter"></i>
        </div>
        
        <div class="progress-section">
          <div class="progress-label">当前电量</div>
          <div class="progress-bar">
            <div class="progress-fill" style="width: 42%"></div>
          </div>
        </div>
        
        <div class="progress-section">
          <div class="progress-label">充电进度</div>
          <div class="progress-bar">
            <div class="progress-fill charge-progress" style="width: 75%"></div>
          </div>
        </div>
        <div class="battery-stats">
          <div class="stat-item">
            <div class="stat-label">充电电压</div>
            <div class="stat-value">11.6V</div>
          </div>
          <div class="stat-item">
            <div class="stat-label">充电电流</div>
            <div class="stat-value">1.7A</div>
          </div>
          <div class="stat-item">
            <div class="stat-label">温度</div>
            <div class="stat-value">28°C</div>
          </div>
          <div class="stat-item">
            <div class="stat-label">预计充满</div>
            <div class="stat-value">2.5h</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'SolarBatteryMonitor'
}
</script>

<style>
.container {
  background: linear-gradient(to bottom, #0f3460, #1a2a6c);
  max-width: 1400px;
  margin: 0 auto;
  height: 80vh;
  display: flex;
  flex-direction: column;
}

/* 太阳能状态区域 */
.solar-status {
  text-align: center;
  margin-bottom: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.solar-status h1 {
  color: #00e5ff;
  font-size: 26px;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.solar-metrics {
  display: flex;
  justify-content: center;
  gap: 30px;
}

.metric-card {
  background: rgba(0, 229, 255, 0.1);
  padding: 15px 30px;
  border-radius: 10px;
  min-width: 200px;
  backdrop-filter: blur(5px);
}

.metric-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 5px;
}

.metric-value {
  font-size: 24px;
  font-weight: bold;
  color: #00e5ff;
}

/* 电池卡片区域 */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 25px;
  flex-grow: 1;
}

.battery-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

/* 电池头部 */
.battery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.battery-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  color: #ffffff;
}

.battery-title i {
  color: #00e5ff;
  font-size: 22px;
}

.battery-status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.working .battery-status {
  background: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
}

.charging .battery-status {
  background: rgba(0, 229, 255, 0.2);
  color: #00e5ff;
}

/* 电池电量显示 */
.battery-level {
  font-size: 42px;
  font-weight: bold;
  color: #00e5ff;
  margin-right: 15px;
}

.battery-icon {
  font-size: 50px;
  color: #00e5ff;
}

.battery-header + div {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

/* 进度条样式 */
.progress-section {
  margin-bottom: 15px;
}

.progress-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
}

.progress-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, #00b8d4, #00e5ff);
  transition: width 0.5s ease;
}

.charge-progress {
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
}

/* 电池参数 */
.battery-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: auto;
}

.stat-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 8px;
  text-align: center;
}

.stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 5px;
}

.stat-value {
  font-size: 18px;
  font-weight: bold;
  color: #00e5ff;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  
  .solar-metrics {
    flex-direction: column;
    gap: 15px;
    align-items: center;
  }
  
  .metric-card {
    width: 100%;
    max-width: 300px;
  }
}
</style>